home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / nurbsToPolyCallback.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  2.9 KB  |  88 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Procedure Name:
  19. //      nurbsToPolyCallback
  20. //
  21. //  Description:
  22. //        Update the option values with the current state of the option box UI.
  23. //
  24. //  Input Arguments:
  25. //      parent - Top level parent layout of the option box UI.  Required so
  26. //               that UI object names can be successfully resolved.
  27. //
  28. //        doIt   - Whether the command should execute.
  29. //
  30. //  Return Value:
  31. //      None.
  32. //
  33.  
  34. global proc nurbsToPolyCallback(string $parent, int $doIt)
  35. {
  36.     setParent $parent;
  37.  
  38.     int $formatButton = `radioButtonGrp -q -sl format`;
  39.     int $formatValue = 1;
  40.     switch( $formatButton ) {
  41.       case 1:
  42.         $formatValue = 2;
  43.         break;
  44.       case 2:
  45.         $formatValue = 0;
  46.         break;
  47.     }
  48.  
  49.     int $formatButton2 = `radioButtonGrp -q -sl format2`;
  50.     switch( $formatButton2 ) {
  51.       case 1:
  52.         $formatValue = 1;
  53.         break;
  54.       case 2:
  55.         $formatValue = 3;
  56.         break;
  57.     }
  58.  
  59.     nurbsToPolygonsPref -format $formatValue;
  60.     nurbsToPolygonsPref -polyType (`radioButtonGrp -q -sl type` - 1);
  61.     nurbsToPolygonsPref -polyCount (`intSliderGrp -q -v count`);
  62.  
  63.     if( $formatValue == 1 ) {        // Format is "Standard Fit"
  64.         nurbsToPolygonsPref -chr (`floatSliderGrp -q -v ratioS`);
  65.     } else {
  66.         nurbsToPolygonsPref -chr (`floatSliderGrp -q -v ratioG`);
  67.     }
  68.     nurbsToPolygonsPref -ft (`floatSliderGrp -q -v fractional`);
  69.     nurbsToPolygonsPref -mel (`floatSliderGrp -q -v minEdgeLength`);
  70.     nurbsToPolygonsPref -d (`floatSliderGrp -q -v delta`);
  71.  
  72.     nurbsToPolygonsPref -uType (`optionMenuGrp -q -sl uType`);
  73.     nurbsToPolygonsPref -uNumber (`intSliderGrp -q -v uNumber`);
  74.     nurbsToPolygonsPref -vType (`optionMenuGrp -q -sl vType`);
  75.     nurbsToPolygonsPref -vNumber (`intSliderGrp -q -v vNumber`);
  76.     nurbsToPolygonsPref -useChordHeight (`checkBoxGrp -q -v1 useChordHeight`);
  77.     nurbsToPolygonsPref -chordHeight (`floatSliderGrp -q -v chordHeight`);
  78.     nurbsToPolygonsPref -useChordHeightRatio
  79.         (`checkBoxGrp -q -v1 useChordHeightRatio`);
  80.     nurbsToPolygonsPref -edgeSwap (`checkBoxGrp -q -v1 edgeSwap`);
  81.  
  82.     if ($doIt) {
  83.         performnurbsToPoly 0;
  84.         addToRecentCommandQueue "performnurbsToPoly 0" "Nurbs To Polygons";
  85.     }
  86. }
  87.  
  88.